import {Department} from './Departments';

abstract class Employee{
  name:string;
  protected workTime:number;
  constructor(name:string){
    this.name = name;
  }
  abstract accept(department:Department):void;
  setWorkTime(time:number):void{
    this.workTime = time;
  }
  getWorkTime():number{
    return this.workTime;
  }
}

class PartTimeEmployee extends Employee{
  private hourWage:number;
  constructor(name:string, wage:number){
    super(name);
    this.hourWage = wage;
  }
  accept(handler:Department):void{
    handler.visitPartTimeEmployee(this);
  }
  setHourWage(wage:number){
    this.hourWage = wage;
  }
  getHourWage():number{
    return this.hourWage;
  }
}

class FullTimeEmployee extends Employee{
  private weeklyWage:number;
  constructor(name:string, wage:number){
    super(name);
    this.weeklyWage = wage;
  }
  accept(handler:Department):void{
    handler.visitFullTimeEmployee(this);
  }
  setWeeklyWage(wage:number){
    this.weeklyWage = wage;
  }
  getWeeklyWage():number{
    return this.weeklyWage;
  }
}

export {
  Employee,
  FullTimeEmployee,
  PartTimeEmployee
};